# coding=utf-8
from src.util.pathutil import SOURCE_DIR
import json


def read_config():
    config_path = SOURCE_DIR.joinpath("config.json")
    content = None
    with open(config_path, "r", encoding="utf-8") as f:
        content = f.read()
    config = json.loads(content)
    return config


def get_db_config():
    config = read_config()
    dbconfig = config.get("db")
    return dbconfig


def get_server_config():
    config = read_config()
    dbconfig = config.get("server")
    return dbconfig
